//
//  DYAddPermissionView.m
//  kafuMerchant
//
//  Created by 帝云科技 on 2018/9/19.
//  Copyright © 2018年 帝云科技. All rights reserved.
//

#import "DYAddPermissionView.h"

@interface DYAddPermissionView ()

@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UITextField *permissionTextField;
@property (nonatomic,strong)UILabel *line;
@property (nonatomic,strong)UILabel *titleLabel2;

@end

@implementation DYAddPermissionView

-(instancetype)initWithFrame:(CGRect)frame
{
    if (self=[super initWithFrame:frame]) {
        [self initView];
    }
    return self;
}
-(void)initView
{
    self.backgroundColor=WhiteColor;
    
    self.titleLabel = ({
        UILabel *label=[Utils labelWithTitle:@"权限组名" titleFontSize:12 textColor:[UIColor xhq_content] backgroundColor:WhiteColor alignment:0];
        label;
    });
    
    self.permissionTextField = ({
        UITextField *text=[[UITextField alloc]init];
        text.placeholder=@"请输入权限组名称";
        [text setValue:[UIColor xhq_assist] forKeyPath:@"_placeholderLabel.textColor"];
        text.font=kFont(14);
        text;
    });
    
    self.line= ({
        UILabel *line=[UILabel xhq_lineLabel];
        line;
    });
    
    self.titleLabel2 = ({
        UILabel *label=[Utils labelWithTitle:@"设置权限" titleFontSize:12 textColor:[UIColor xhq_content] backgroundColor:WhiteColor alignment:0];
        label;
    });
    
    [self addSubview:self.titleLabel2];
    [self addSubview:self.titleLabel];
    [self addSubview:self.permissionTextField];
    [self addSubview:self.line];
    
    [self.titleLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(BILIWIDTH(10));
        make.top.equalTo(BILIHEIGHT(15));
    }];
    
    [self.permissionTextField makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleLabel);
        make.top.equalTo(self.titleLabel.bottom).offset(BILIHEIGHT(5));
        make.height.equalTo(BILIHEIGHT(25));
        make.right.equalTo(BILIWIDTH(-10));
    }];
    
    [self.line makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(self.permissionTextField);
        make.top.equalTo(self.permissionTextField.bottom);
        make.height.equalTo(BILIWIDTH(0.7));
    }];
    
    [self.titleLabel2 makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleLabel);
        make.bottom.equalTo(0);
    }];

    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
